import java.util.Comparator;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-05-21
 * Time: 20:05
 */
class Money implements Cloneable {
    public double m = 100;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
public class Student implements Comparable<Student>,Cloneable{
    public String name;
    public Money money = new Money();

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Student tem = (Student) super.clone();
        tem.money = (Money) this.money.clone();
        return tem;
    }

    public int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public int compareTo(Student o) {
        return this.name.compareTo(o.name);
        //return this.age - o.age;
    }
}
